<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>debounce</title>
    <style>
      #container {
        width: 100%;
        height: 200px;
        line-height: 200px;
        text-align: center;
        color: #fff;
        background-color: #444;
        font-size: 30px;
      }
    </style>
  </head>
  <body>
    <div id="container"></div>
    <script>
      var count = 1;
      var container = document.getElementById("container");
      function getUserAction(a, e) {
        // console.log(this);
        console.log(a, e);
        container.innerHTML = count++;
      }

      // 事件的用法
      container.onmousemove = getUserAction;
      // 事件绑定参数用法
      // container.addEventListener('mousemove', getUserAction.bind(null, 1))

    </script>
  </body>
</html>
